global class POUpdate implements Database.Batchable<sObject>{
String query = ' SELECT Id, Name, Ownerid FROM Employee_Detail__c ';
String email;
Id toUserId;
Id fromUserId;
global Database.querylocator start(Database.BatchableContext BC){
            return Database.getQueryLocator(query);}
global void execute(Database.BatchableContext BC, List<sObject> scope){
    List<Purchase_Object__c> accns = new List<Purchase_Object__c>();
   for(sObject s : scope){Purchase_Object__c a = (Purchase_Object__c)s;
        if(a.OwnerId==fromUserId){
            a.OwnerId=toUserId;
            accns.add(a);
            }
        }
update accns;  
 }
 global void finish(Database.BatchableContext BC){}
}